﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Stimulsoft.Report;
using Stimulsoft.Report.Dictionary;

namespace Gemciler_Uretim.Raporlar
{
    public partial class BarkodBasimEkrani : DevExpress.XtraEditors.XtraForm
    {
        public BarkodBasimEkrani()
        {
            InitializeComponent();
        }
        SqlConnecitonClass sqlbaglanti = new SqlConnecitonClass();
        public int aktif_kullanici, rapor_tablo_no,kayitno;
        public string AppPath = System.Windows.Forms.Application.StartupPath, yazdir_conectstring,secilen_rapor_dosyasi="SevkBarkod.mrt";
        
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            Close();
        }
        private void FormTasarim()
        {

       
                try
                {
                    StiReport report = new StiReport();
                    report.Load("" + AppPath + "\\Form\\" + secilen_rapor_dosyasi + "");
                    report.Dictionary.Databases.Clear();
                    report.Dictionary.Databases.Add(new StiSqlDatabase("RAPORDATA", "" + yazdir_conectstring + ""));
                 
                   
                        report["@kayitno"] = kayitno;
                        report.Design();
                    
                    
                }
                catch { MessageBox.Show("RAPOR SEÇİLMEDİ YADA RAPOR DOSYASI YOK ?"); }
            
        }
        private void FormDok()
        {
           
                try
                {
                    StiReport report = new StiReport();
                    report.Load("" + AppPath + "\\Form\\" + secilen_rapor_dosyasi + "");
                    report.Dictionary.Databases.Clear();
                    report.Dictionary.Databases.Add(new StiSqlDatabase("RAPORDATA", "" + yazdir_conectstring + ""));

                  
                     
                        
                        report.ShowWithRibbonGUI();
                    
                }
                catch { MessageBox.Show("RAPOR SEÇİLMEDİ YADA RAPOR DOSYASI YOK ?"); }
            

        }
        private void FormYazdir()
        {
            
                try
                {
                    StiReport report = new StiReport();
                    report.Load("" + AppPath + "\\Form\\" + secilen_rapor_dosyasi + "");
                    report.Dictionary.Databases.Clear();
                    report.Dictionary.Databases.Add(new StiSqlDatabase("RAPORDATA", "" + yazdir_conectstring + ""));

                  
                   
                        report["@kayitno"] = kayitno;
                        report.Print();
                    
                }
                catch { MessageBox.Show("RAPOR SEÇİLMEDİ YADA RAPOR DOSYASI YOK ?"); }
           
        }
        private void buton_tasarim_Click(object sender, EventArgs e)
        {
            this.Hide();

            FormTasarim();
            this.Show();
        }
    }
}